package demo7;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Collectors;

/**
 * @author 24岁没牵过女人的手
 * 日期：2023/9/8 21:16
 * 文件描述：
 */
public class Main {
    public static  <T,INPUT> T get(INPUT input){
        if(input instanceof Integer){
            T s = (T) input.toString();
            return s;
        }
        return null;
    }

    public static void main(String[] args) {
        Object o = get(2);
        System.out.println(o);
        List<String> list = new ArrayList<>();
        list.add("xiaowen1");
        list.add("xiaowen2");
        list.add("xiaowen3");
        list.add("xiaowen4");
        System.out.println(list);
        Object[] objects = list.toArray();
        System.out.println(objects);
        List<Object> objects1 = Arrays.asList(objects);
        Collections.reverse(list);
        System.out.println(list);
        System.out.println(objects1);
        List<Object> collect = Arrays.stream(objects).collect(Collectors.toList());
        ArrayList<Object> objects2 = new ArrayList<>(collect);
        System.out.println(objects2);
    }
}
